//
// Base
//

*,
::before,
::after {
	box-sizing: border-box;
}

* {
	padding: 0;
	margin: 0;
}

::selection {
	//color: $selection-color;
	//background-color: $selection-bg;
}

::-moz-focus-inner {
	border: 0;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 12px;
	// TODO: Remove --note-font-size, as it's probably not necessary to change font size for highlights and comments
	--note-font-size: 12 / 16 * 1rem;
	--bottomPlaceholderHeight: 0;
}

:root {
	color-scheme: light dark;
	background-color: Window;
	font-family: var(--font-family);
	font-size: var(--font-size);
	font-style: normal;
	@if $platform == 'zotero' {
		@media (-moz-platform: windows) {
			--color-accent: var(--accent-blue);
			@include light-dark(--color-focus-border, #000, #fff);
			--width-focus-border: 2px;
		}
		@media (-moz-platform: macos) {
			--color-accent: SelectedItem;
			--color-focus-border: color-mix(in srgb, var(--color-accent) 70%, transparent);
			--width-focus-border: 3px;
		}
		@media (-moz-platform: linux) {
			--color-accent: SelectedItem;
			--color-focus-border: var(--color-accent);
			--width-focus-border: 2px;
		}
	} @else if $platform == 'web' {
		--color-accent: SelectedItem;
		--color-focus-border: color-mix(in srgb, var(--color-accent) 70%, transparent);
		--width-focus-border: 3px;
	} @else if $platform == 'dev' {
		--color-accent: SelectedItem;
		--color-focus-border: color-mix(in srgb, var(--color-accent) 70%, transparent);
		--width-focus-border: 3px;
	}
	--color-focus-search: color-mix(in srgb, var(--color-accent) 70%, transparent);
}

// Remove default button styling
button {
	all: unset;
	outline: revert;
	display: block;
	box-sizing: border-box;
	background: none;
	color: inherit;
	border: none;
	padding: 0;
	font: inherit;
	outline: inherit;

	&:focus-visible {
		outline: none;
		border-color: rgba(0,0,0,0);
		box-shadow: 0 0 0 var(--width-focus-border) var(--color-focus-search);
	}

	&:-moz-focusring {
		outline: none;
		border-color: rgba(0,0,0,0);
		box-shadow: 0 0 0 var(--width-focus-border) var(--color-focus-search);
	}

	@if $platform == "web" {
		&:not([disabled]) {
			cursor: pointer;
		}
	}

	&:disabled {
		opacity: $btn-disabled-opacity;
	}
}

input:not([type="checkbox"]),
button,
select {
	font-family: inherit;
	font-size: inherit;
	outline: none;
}

input {
	color: var(--fill-primary);
}

@page {
	margin: 0;
}

#printContainer {
	display: none;
}

@media print {
	body {
		background: rgba(0, 0, 0, 0) none;
	}

	// If extra pages appear it means there are elements after #printContainer
	#reader-ui {
		display: none;
	}

	.page, .page canvas {
		position: static;
		padding: 0;
		margin: 0;
	}

	.page {
		float: left;
		display: none;
		border: none;
		box-shadow: none;
		background-clip: content-box;
		background-color: rgba(255, 255, 255, 1);
	}

	.page[data-loaded] {
		display: block;
	}

	body[data-pdfjsprinting] #printContainer {
		display: block;
	}
	#printContainer {
		height: 100%;
	}
	/* wrapper around (scaled) print canvas elements */
	#printContainer > div {
		position: relative;
		top: 0;
		left: 0;
		width: 1px;
		height: 1px;
		overflow: visible;
		page-break-after: always;
		page-break-inside: avoid;
	}
	#printContainer canvas,
	#printContainer img {
		direction: ltr;
		display: block;
	}
}

body.freeze {
	&:before {
		content: "";
		position: absolute;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: $z-index-freeze-cover;
		background-color: rgba(1, 1, 1, 0.1);
	}
}

.custom-sections:empty {
	display: none;
}

.icon {
	svg {
		display: block;
		color: currentColor;
	}
}
